package com.xc.stock.infrastructure.db.po;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.UpdateTimestamp;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

/**
 * AccountPO
 *
 * @author xlfd
 * @email xlfd@gmail.com
 * @created 2022/03/25
 */
@SuperBuilder
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name = "account")
public class AccountPO {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	Integer id;

	String accountNo;

	String destId;
	String destName;
	String destPhone;

	/**
	 * 账户角色[用户/商家/代理]
	 */
	String role;

	/**
	 * []
	 */
	String accountType;
//	String source;
	Integer pId;

	String currency;

	/**
	 * 总使用过的余额
	 */
	BigDecimal total;

	/**
	 * 有效余额
	 */
	BigDecimal balance;

	/**
	 * 锁定余额
	 */
	BigDecimal lockAmount;

	BigDecimal willIncomeAmount;

	/**
	 * 限制提现余额
	 */
	BigDecimal limitWithdrawAmount;
	BigDecimal withdrawAmount;
	BigDecimal stampTax;
	BigDecimal commission;
	BigDecimal recharge;
	BigDecimal preTradingDay;

	/**
	 * 账户状态
	 */
	Integer status;

	String ext;
	/**
	 * 是否可提现
	 */
	Integer withdrawFlag;

	@CreationTimestamp
	@Column(updatable = false)
	Date createAt;

	@UpdateTimestamp
	Date updateAt;
}
